import Mock from 'mockjs'

// 查询课程开通列表
export const getCourseOpenPage = async (params: CourseOpen): Promise<ListCourseOpenRes> => {
  const res = await Mock.mock({
    'list|10': [
      {
        'id|+1': 1,
        clientUserName: '@cname',
        courseName: '@cword(3, 5)',
        'courseType|1': [1, 2],
        'courseStatus|1': [1, 2],
        validDays: 365,
        createTime: 1691727146870
      }
    ],
    total: 100,
    pageNo: 1,
    pageSize: 10
  })
  return res
}

// 查询课程开通详情
export const getService = async (id: number) => {
  const res = await Mock.mock({
    'id|+1': 1,
    clientUserName: '@cname',
    courseName: '@cword(3, 5)',
    courseType: '@cword(3, 5)',
    'courseStatus|1': [1, 2],
    validDays: 365,
    createTime: 1691727146870
  })
  return res
}

// 修改课程开通
export const updateCourse = async (data: CourseOpen): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}

// 删除课程开通记录
export const deleteCourse = async (id: number): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}
